/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.hcrhs.frc2012.subsystems;

import edu.hcrhs.frc2012.RobotMap;
import edu.hcrhs.frc2012.commands.DisplayDirection;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.command.Subsystem;

/**
 *
 * @author Szymon Morawski
 */
public class DriveDirectionIndicator extends Subsystem {
    // Put methods for controlling this subsystem
    // here. Call these from Commands.

    private Relay direction;
    private volatile boolean driveForward;
    
    public DriveDirectionIndicator()
    {
        super("DriveDirectionIndicator");
        direction = new Relay(RobotMap.Traction.drivingDirectionRelay, 
                              Relay.Direction.kBoth);
        driveForward = true;
    }

    public void initDefaultCommand() {
        // Set the default command for a subsystem here.
        setDefaultCommand(new DisplayDirection());
    }
    
    public void setForwardDirection()
    {
        driveForward = true;
        direction.setDirection(Relay.Direction.kForward);
    }
    
    public void setReverseDirection()
    {
        driveForward = false;
        direction.setDirection(Relay.Direction.kReverse);
    }
    
    
    public void doNothing()
    {
        
    }
    
    public boolean isDrivingForward()
    {
        return driveForward;
    }
}
